const ua = window.navigator.userAgent;
let isMobile = false;
if(ua.indexOf('iPhone') >= 0) isMobile = true;
if(ua.indexOf('Android') >= 0) isMobile = true;
if(ua.indexOf('iPad') >= 0) isMobile = true;

const path = isMobile ? '/mobile' : '';

const routers = [{
  path: '/',
  meta: {
    title: ''
  },
  redirect: '/index',
  component: (resolve) => require(['./views'+ path +'/layout.vue'], resolve),
  children: [
    {
      path: '/index',
      meta: {
        title: '首页'
      },
      name: "index",
      component: (resolve) => require(['./views/index.vue'], resolve),
    },
    {
      path: '/t11',
      meta: {
        title: 'T11介绍'
      },
      name: "t11",
      component: (resolve) => require(['./views/t11.vue'], resolve),
    },
    {
      path: '/consult',
      meta: {
        title: '咨询'
      },
      name: "consult",
      redirect: "/consult/consultLists",
      component: (resolve) => require(['./views/consult/consult.vue'], resolve),
      children: [
        {
          path: 'consultLists',
          meta: {
            title: '动态中心'
          },
          name: "consultLists",
          component: (resolve) => require(['./views/consult/consultLists.vue'], resolve)
        },
        {
          path: 'consultItem',
          meta: {
            title: '动态中心'
          },
          name: "consultItem",
          component: (resolve) => require(['./views/consult/consultItem.vue'], resolve)
        },
      ]
    },
    {
      path: '/education',
      meta: {
        title: '品牌教育'
      },
      name: "education",
      component: (resolve) => require(['./views/education.vue'], resolve),
    },
    {
      path: '/specialty',
      meta: {
        title: '课程'
      },
      name: "specialty",
      redirect: "/specialty/piano",
      component: (resolve) => require(['./views/specialty/specialty.vue'], resolve),
      children: [
        {
          path: 'fairyTale',
          meta: {
            title: '唯乐童话'
          },
          name: "fairyTale",
          component: (resolve) => require(['./views/specialty/fairyTale.vue'], resolve),
        },
        {
          path: 'piano',
          meta: {
            title: '唯乐钢琴'
          },
          name: "piano",
          component: (resolve) => require(['./views/specialty/piano.vue'], resolve),
        },
        {
          path: 'streetDance',
          meta: {
            title: 'N+街舞'
          },
          name: "streetDance",
          component: (resolve) => require(['./views/specialty/streetDance.vue'], resolve),
        },
        {
          path: 'latinDance',
          meta: {
            title: '新秀拉丁舞'
          },
          name: "latinDance",
          component: (resolve) => require(['./views/specialty/latinDance.vue'], resolve),
        },
        {
          path: 'calligraphy',
          meta: {
            title: '卓艺书画'
          },
          name: "calligraphy",
          component: (resolve) => require(['./views/specialty/calligraphy.vue'], resolve),
        },
        {
          path: 'ceramic',
          meta: {
            title: '陶工坊'
          },
          name: "ceramic",
          component: (resolve) => require(['./views/specialty/ceramic.vue'], resolve),
        },
        {
          path: 'taekwondo',
          meta: {
            title: '至正弘仁跆拳道'
          },
          name: "taekwondo",
          component: (resolve) => require(['./views/specialty/taekwondo.vue'], resolve),
        },
        {
          path: 'science',
          meta: {
            title: '领越科教'
          },
          name: "science",
          component: (resolve) => require(['./views/specialty/science.vue'], resolve),
        },
        {
          path: 'supermode',
          meta: {
            title: '凡盛超模星学院'
          },
          name: "supermode",
          component: (resolve) => require(['./views/specialty/supermode.vue'], resolve),
        },
        {
          path: 'eloquence',
          meta: {
            title: '领秀口才'
          },
          name: "eloquence",
          component: (resolve) => require(['./views/specialty/eloquence.vue'], resolve),
        },
        {
          path: 'music',
          meta: {
            title: '格莱美音乐'
          },
          name: "music",
          component: (resolve) => require(['./views/specialty/music.vue'], resolve),
        },
        {
          path: 'sports',
          meta: {
            title: '乐体体育'
          },
          name: "sports",
          component: (resolve) => require(['./views/specialty/sports.vue'], resolve),
        },
        {
          path: 'dancingSchool',
          meta: {
            title: '华艺中国舞'
          },
          name: "dancingSchool",
          component: (resolve) => require(['./views/specialty/dancingSchool.vue'], resolve),
        },
      ]
    },
    {
      path: '/tutor',
      meta: {
        title: '名师'
      },
      name: "tutor",
      component: (resolve) => require(['./views/tutor/tutor.vue'], resolve),
      redirect: "/tutor/consultLists",
      children: [
        {
          path: 'consultLists',
          meta: {
            title: '名师'
          },
          name: "consultLists",
          component: (resolve) => require(['./views/tutor/consultLists.vue'], resolve),
        },
        {
          path: 'tutorItem',
          meta: {
            title: '名师介绍'
          },
          name: "tutorItem",
          component: (resolve) => require(['./views/tutor/tutorItem.vue'], resolve),
        },
      ]
    },
    {
      path: '/recruit',
      meta: {
        title: '招生'
      },
      name: "recruit",
      component: (resolve) => require(['./views/recruit.vue'], resolve),
    },
    {
      path: '/works',
      meta: {
        title: '作品'
      },
      name: "works",
      redirect: '/works/mien',
      component: (resolve) => require(['./views/works.vue'], resolve),
      children: [
        {
          path: 'mien',
          meta: {
            title: '风采'
          },
          name: "mien",
          component: (resolve) => require(['./views/works/mien.vue'], resolve),
        },
        {
          path: 'environment',
          meta: {
            title: '环境'
          },
          name: "environment",
          component: (resolve) => require(['./views/works/environment.vue'], resolve),
        },
        {
          path: 'dance',
          meta: {
            title: '舞蹈类'
          },
          name: "dance",
          component: (resolve) => require(['./views/works/dance.vue'], resolve),
        },
      ]
    },
    {
      path: '/jion',
      meta: {
        title: '加盟'
      },
      name: "jion",
      component: (resolve) => require(['./views/jion.vue'], resolve),
    },
    {
      path: '/relation',
      meta: {
        title: '联系'
      },
      name: "relation",
      component: (resolve) => require(['./views/relation.vue'], resolve),
    },
    {
      path: '/activity',
      meta: {
        title: '活动中心'
      },
      name: "activity",
      component: (resolve) => require(['./views/activity.vue'], resolve),
    },
  ]

}];
export default routers;